package cn.momoshenchi.product;

import cn.momoshenchi.product.entity.CategoryEntity;
import cn.momoshenchi.product.service.CategoryService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @version : 1.0
 * @author: momoshenchi
 * @date: 2021/4/30 - 17:25
 */
@SpringBootTest
public class Gs
{
    @Autowired
    private CategoryService categoryService;
    @Test
    public  void te1()
    {
        Long[] path = categoryService.findCategoryPath(225L);
        System.out.println(Arrays.toString(path));
    }
    @Test
    public void listWithTree2()
    {
        List<Integer> entities = new ArrayList<>();
//        entities.add(0);
        List<Integer> collect = entities.stream().filter(item -> {
             return item ==1;
        }).collect(Collectors.toList());
        entities.forEach(System.out::println);
        collect.forEach(System.out::println);
        System.out.println(collect.isEmpty());
//        return level1;
    }
}
